<html>
<head>
<title>Cnr2</title>
   <link rel="stylesheet" type="text/css" href="../../avisynth.css">
<!--
Automatically generated, don't change:
$Id: cnr2.htm,v 1.3 2004/08/13 21:57:25 wilbertd Exp $ 
-->
</head>
<body>
<h1>Cnr2 (Chroma Noise Reducer)</h1>
<h2>Abstract</h2>
<b>author:</b> Chroma Noise Reducer by MarcFD and others<br>
<b>version:</b>   2.61<br>
<b>dowload:</b> <a href="http://www.avisynth.org/warpenterprises/">http://www.avisynth.org/warpenterprises/</a>
<br><b>category:</b> Temporal Smoothers
<br><b>requirements:</b>  
<ul>
  <li>YV12 &amp; YUY2 Colorspace</li>
</ul>
<hr>
<font face="verdana">
<h2>What it does</h2>
<p>This filter is a Chroma Stabilizer for analogic sources.<br>
  It's a temporal filter and it's very effective against two chroma artifacts:
stationary rainbows and huge analogic chroma activity.</p>
<h2>Usage</h2>
  Add the following lines in your avisynth script :
<pre></font><font face="Verdana">LoadPlugin(&quot;Cnr2.dll&quot;)
# example
Cnr2() # for TV/VHS caps
Cnr2(&quot;xxx&quot;, 4, 5, 255) # my suggestion to remove rainbows.</font></pre>
<p><font face="verdana">Syntax :
</font>
</p>
<p><code><font face="verdana">Cnr2
</font>
</code>
<font face="Verdana"> (clip, <var>mode=&quot;oxx&quot;, scdthr=8, ln=35, lm=192,
un=47), um=255, vn=47, vm=255, log=false</var>)</font>
</p>
<p><font face="Verdana"><var>mode</var></font><font face="verdana"> :
</font>
</p>
<p><font face="verdana">mode of each components, &quot;YUV&quot;<br>
    two modes are possible : wide ('o') and narrow ('x')<br>
    narrow mode is more sensible to variations, and less effective
</font>
</p>
<p><font face="Verdana"><var>scdthr</var></font><font face="verdana"> :
</font>
</p>
<p><font face="verdana">scenechange detection threshold.<br>
    lower it to make scd more sensible.<br>
    if a scenechange is detected, cnr2 will<br>
    reset the filtering for the new scene
</font>
</p>
<p><font face="Verdana"><var>ln,lm,un,um,vn,vm</var></font><font face="verdana"> : 0 to 255</p>
    the n values are the movement sensibility :<br>
    higher values will denoise more, but could produce ghosting artifacts<br>
    the m values are the maximum effectiveness of the denoiser :<br>
    lower them to reduce the denoising effect.
</font>
<p><font face="Verdana"><var>log</var></font><font face="verdana"> :</p>
    to log scd internals. use DebugView to see it.
<pre>&gt; Cnr2()
&gt; Cnr2(&quot;oxx&quot;, 8, 35, 192, 47, 255, 47, 255, false)
&gt; Cnr2(mode=&quot;oxx&quot;, scdthr=8, ln=35, lm=192, un=47, um=255, vn=47, vm=255, false)</pre>
<p>are three aliases : they would produce the same filtering.<br>
</p>
<h2>History</h2>
  This Filter is inspired by the Virtual Dub filter Chroma Noise Reduction 1.1
  (by Gilles Mouchard)<br>
  cnr 1.1 was a good chroma filter but was using YUV conversion to do is job.<br>
  I used it for VHS encodes, because it was the better Chroma Noise filter i
  tested<br>
  But when i started to use AviSynth and Huffyuv, RGB convertion was an overhead<br>
  So i take a look on the code and wrote my own filter from scratch, but based
  of the same algo.<br>
  the output of cnr2 is 99,9% to 100% the same as cnr (due to YUV colorspace)<br>
  and it's 3x-5x faster (Cnr2 can do real-time denoising in 640x480x25fps with a
  1,4 Ghz CPU)
<p><u>version 2.1 (31.7.2002)</u></p>
<p>&nbsp;&nbsp;&nbsp; little review. corrections.</p>
<p><u>version 2.2 (01.8.2002)</u></p>
<p>&nbsp;&nbsp;&nbsp; First frame bug fixed.</p>
  <u>version 2.3 (17.11.2002)</u>
<p>&nbsp;&nbsp;&nbsp; YV12 Code and SCD (scene change detection)</p>
<p><u>version 2.4 (17.11.2002)</u></p>
<p>&nbsp;&nbsp;&nbsp; small changes/bug fixes</p>
  <u>version 2.51 (13.11.2003)</u>
<p>&nbsp;&nbsp;&nbsp; Klaus Post: bug fixes.</p>
<u>
      version 2.6 (29.06.2004)</u>
<p>&nbsp;&nbsp;&nbsp; tritical: few bug fixes, scene change detection overhaul, code cleanup.&nbsp;</p>
<p><u>version 2.6.1 (30.06.2004)</u></p>
<p>&nbsp;&nbsp;&nbsp; tritical: made yuy2 processing fast again.&nbsp;<br>
</p>
<h3>Distribution :</h3>
  This is a free sofware distribued under the terms of the GNU-GPL<br>
  The only restriction is to e-mail me if you want to do something with<br>
  the source because i don't want you to lose your time to decode my<br>
  cryptic C,C++,Delphi (or any other language) writing.<br>
  Thanks :)<br>
<h3>Contact :</h3>
  Don't even doubt of <a href="mailto:marc.fd@libertysurf.fr">e-mailing me</a>
  for any suggestion :-), bug report :-(,<br>
  feature request :D, or whatever else :-P.<br>
  I hope you'll find this prog useful ! (i do...)
</font>
<p><font face="Verdana"><kbd>$Date: 2004/08/13 21:57:25 $</kbd></font></p>
</body>
</html>
